package org.example.auth.domain;

import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import org.example.common.core.enums.GrantUser;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
public class BaseLoginBody implements Serializable {
    /**
     * 租户编号
     */
    @NotBlank(message = "{tenant.number.not.blank}")
    protected  String tenant_id;
    /**
     * 验证码
     */
    protected  String code;
    /**
     * 验证码uuid
     */
    protected  String uuid;
    /**
     * token有效期
     */
    protected Integer expires_in;
    /**
     * 用户类型
     */
    @NotNull(message = "{auth.grant.user.not.blank}")
    protected GrantUser grant_user;
    /**
     * 认证类型
     */
    protected String grant_type;

    /**
     * 认证设备
     */
    protected String device_type;

    /**
     * 客户端ID
     */
    protected String client_Id;


    public boolean isCode(){
        return ObjectUtil.isNotEmpty(code);
    }
}
